package com.platform.dao.mybatis.impl;

import com.platform.domain.model.UserAuthorizationKey;
import com.platform.dao.UserAuthorizationDao;
import com.platform.dao.mybatis.mapper.UserAuthorizationMapper;
import com.platform.domain.model.UserAuthorization;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
* UserAuthorization
*
* User: wangyang
* DateTime: 2012-10-08 16:11:49
*
*/
@Service("userAuthorizationDao")
public class UserAuthorizationDaoImpl implements UserAuthorizationDao {

    @Resource
    private UserAuthorizationMapper userAuthorizationMapper;

    /**
    *
    * 根据主键查询UserAuthorization对象
    *
    * @param key
    * @return UserAuthorization对象
    */
    @Override
    public UserAuthorization selectByPrimaryKey(UserAuthorizationKey key) throws Exception {
        return userAuthorizationMapper.selectByPrimaryKey(key);
    }

    /**
    *
    * 根据查询条件查询符合条件的UserAuthorization对象
    *
    * @param userAuthorization
    * @return 符合条件的UserAuthorization对象List
    */
    @Override
    public List<UserAuthorization> select(UserAuthorization userAuthorization) throws Exception {
        return userAuthorizationMapper.select(userAuthorization);
    }

    /**
    *
    * 根据主键删除UserAuthorization对象
    *
    * @param key
    * @return 影响条件数
    */
    @Override
    public int deleteByPrimaryKey(UserAuthorizationKey key) throws Exception {
        return userAuthorizationMapper.deleteByPrimaryKey(key);
    }

    /**
    *
    * 根据条件删除符合条件的UserAuthorization对象
    *
    * @param userAuthorization
    * @return 影响条件数
    */
    @Override
    public int delete(UserAuthorization userAuthorization) throws Exception {
        return userAuthorizationMapper.delete(userAuthorization);
    }

    /**
    *
    * 插入UserAuthorization对象
    *
    * @param userAuthorization
    * @return 影响条件数
    */
    @Override
    public int insert(UserAuthorization userAuthorization) throws Exception {
        return userAuthorizationMapper.insert(userAuthorization);
    }

    /**
    *
    * 更新UserAuthorization对象
    *
    * @param userAuthorization
    * @return 影响条件数
    */
    @Override
    public int update(UserAuthorization userAuthorization) throws Exception {
        return userAuthorizationMapper.update(userAuthorization);
    }
}
